package Demo06;

import java.util.Random;

public class Demo06RangomGame1 {
    public static void main(String[] args) {
        Random t = new Random();
        int k = t.nextInt(100) + 1;
        int a = t.nextInt(100) + 1;
        System.out.println("请输入1-100之间的数字。");
        System.out.println("您输入的数字为：" + a);
        while(a != k){
            if (a < k){
                System.out.println("您输入的数字小了沙雕，请继续输入！");
            }else if(a > k){
                System.out.println("您输入的数字大了笨蛋，请继续输入！");
            }
            a = t.nextInt(100) + 1;
            System.out.println(a);

        }
        System.out.println("试了那么多次，造孽啊，不过恭喜，回答正确！");

    }
}
